package com.swak.rabbit.message;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 待确认的数据
 * 
 * @author lifeng
 */
@Getter
@Setter
@Accessors(chain = true)
public class PendingConfirm implements Serializable {

	private static final long serialVersionUID = 1L;

	private String id;
	private String cause;
	private int retryTimes = 3; // 总共重试三次
	private long retryPeriod = 5 * 1000; // 重试5秒

	// 消息重试时需要设置的消息
	private String exchange;
	private String routingKey;
	private Integer deliveryMode = 2; // 发布模式1(不持久化)， 2(持久化) 默认是持久化的消息，可以更改
	private Integer priority; // 消息的优先级 0 - 9
	private String expiration; // 消息的 ttl
	private byte[] payload; // 消息的内容

	public PendingConfirm() {
	}

	public PendingConfirm(String id) {
		this.id = id;
	}
}